#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
struct student *create();
void print(struct student *head);
struct student *del(struct student *head,int num);

struct student {
	int num;
	char name[10];
	int score;
	struct student *next;
}; 
int n;
int main()
{
    struct student *stu;
    
    stu=create();
    print(stu);
    printf("\n\n");
    system("pause");
	
	return 0;	
} 
struct student *create(){
	struct student *head;
	struct student *p1,*p2;
	
	p1=p2=(struct student *)malloc(sizeof(struct student));
	
	scanf("%d %s",&p1->num,&p1->score);
	head=NULL;
	n=0;
	
	while(p1->num!=0){
		n++;
		if(n==1){
			head=p1;
		}else{
			p2->next=p1;
		}
		p2=p1;
		p1=(struct student*)malloc(sizeof(struct student));
		printf("%d %s",&p1->num,&p1->score);
	}
	p2->next=NULL;
	return head;
}
void print(struct student *head){
	struct student *p;
	
	p=head;
	if(head!=NULL){
		do{
			printf("%d %d",p->num,p->score);
			p=p->next;
		}while(p!=NULL);
	}	
}
